struct Character {
    name: String,
}

/// drop特征类似对象析构，包含drop方法，对象超出作用域就会被调用
impl Drop for Character {
    fn drop(&mut self) {
        println!("{} went away", self.name)
    }
}

fn main() {
    let _steve = Character {name: "Steve".into()};
    let _john = Character {name: "John".into()};
}